package com.lqm.service.home.impl;

import com.lqm.dao.SlideDao;
import com.lqm.entity.home.Slide;
import com.lqm.service.home.SlideService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: CrowdFunding
 * @description
 * @author: lqm
 * @create: 2018-12-13 16:38
 */
@Service
public class SlideServiceImpl implements SlideService {

    @Autowired
    SlideDao slideDao;

    @Override
    public List<Slide> getAllSlide() {
        Sort sort = new Sort(Sort.Direction.DESC, "slideId");

        return slideDao.findAllByStatus(1,sort);
    }

    @Override
    public long getCount() {
        return slideDao.count();
    }

//    @Override
//    public Project setSlideStatus(Slide slide, int status) {
//        return slideDao.setSlideStatus(slide,status);
//    }
}
